import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:industry_net/base/common/util.dart';
import 'package:industry_net/base/component/list/table_view.dart';

import 'package:industry_net/pages/news/main/views/content/effect.dart';

import 'controller.dart';

class ContentPage extends StatelessWidget {
  ContentPage({Key? key, required this.index}) : super(key: key) {
    effect = Get.find<ContentController>().state.state.contentCtrls[index];
  }
  final int index;
  final controller = Get.put(ContentController());
  late ContentEffect effect;
  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.only(top: 15.r),
      decoration: BoxDecoration(
          color: ColorsUtil.white,
          borderRadius: BorderRadius.vertical(top: Radius.circular(25.r))),
      child: TableView(
        refreshController: effect.refreshCtrl,
        onRefresh: controller.onRefresh,
        onLoading: controller.onLoading,
        separatorIndent: gap12,
        data: controller.state.dataSource,
      ),
    );
  }
}
